package com.hnevc.market;

public class Market {
	private Product[] productList;
	private String marketName;
	public String getMarketName() {
		return marketName;
	}
	public void setMarketName(String marketName) {
		this.marketName = marketName;
	}
	public Product[] getProductList() {
		return productList;
	}
	public void setProductList(Product[] productList) {
		this.productList = productList;
	}
	//卖货
	public Product sell(String productName){
		for(int i=0;i<productList.length;i++){
			if(productList[i].getProductName() .equals(productName)){
				return productList[i];
			}
		}
		return null;
	}
	@Override
	protected void finalize(){
		System.out.println("释放Market");
	}
}
